package org.example.ioc;

import lombok.extern.slf4j.Slf4j;

import java.util.UUID;

@Slf4j
public class ServiceA {

    private final String name;
    private final ServiceB serviceB;

    public ServiceA(ServiceB serviceB) {
        this.serviceB = serviceB;
        this.name = UUID.randomUUID().toString();
        log.info("construct %s(%s -> %s)".formatted(this.getClass().getSimpleName(), this.name, this.serviceB.getName()));
    }

    public String getName() {
        return name;
    }

    public ServiceB getServiceB() {
        return serviceB;
    }
}
